import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

import Home from '../views/home/index.vue'
import My from '../views/my/index.vue'
import Category from '../views/category/index.vue'
import Cart from '../views/cart/index.vue'
import Login from '../views/login/index.vue'
import Reg from '../views/reg/index.vue'
// import Layout from '../components/layout/index.vue'
import Placeholder from '../components/layout/placeholder.vue'

const routes = [{
		path: '/',
		component: Placeholder,
		children: [{
				path: '/',
				name: 'home',
				component: Home
			},
			{
				path: '/category',
				name: 'category',
				component: Category
			},
			{
				path: '/cart',
				name: 'cart',
				component: Cart
			},
			{
				path: '/my',
				name: 'my',
				component: My
			}
		]
	},
	{
		path: '/login',
		name: 'login',
		component: Login
	},
	{
		path: '/reg',
		name: 'reg',
		component: Reg
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
